home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 24 / AACD 24.iso / AACD / Online / Epic4 / share / epic / help / 6_functions / read < prev    next >
Text File  |  2001-03-21  |  953b  |  28 lines

  1. Synopsis:
  2.    $read(<fd> [<length>])
  3.  
  4. Technical:
  5.    This function is used to read data from a file pointed to by the given
  6.    file descriptor.  The file descriptor is returned when the file is
  7.    opened for reading with the $open() function.  If a second argument is
  8.    passed, that many bytes are read and returned; otherwise, it reads up
  9.    to the next newline.
  10.  
  11. Practical:
  12.    This function is the general-purpose interface to reading file contents.
  13.    The normal usage is to just read a file line by line.  However, since
  14.    you can also read an arbitrary number of bytes, it can also be used to
  15.    read binary files (finding a use for this is left as an exercise for the
  16.    user).
  17.  
  18. Returns:
  19.    data read from file, or nothing on error
  20.  
  21. Examples:
  22.    $read(4)                           returns next line from fd 4
  23.    $read(4 30)                        returns next 30 bytes from fd 4
  24.  
  25. See Also:
  26.    close(6); open(6); randread(6)
  27.  
  28.